package site.codeyin.javautils.utils.filedownLoad;

import java.io.File;
import java.io.IOException;

/**
 * @author <a href="https://github.com/liangcheng2221">yinjie</a>
 * @date 2024-11-11 22:09
 */
public class Main {
    static final String LOCAL_PATH_DIR = System.getProperty("user.dir") + "/temp/"; // 下载到本地的文件目录

    public static void main(String[] args) throws IOException {
        String serverPath = "https://boot-video.xuexi.cn/video/1004/p/fc717e16c2ea5deb638713c3f88a136d-7721b113f8a14dd38b6aeafb14d9399a-3.mp4";


        System.out.println(new File(LOCAL_PATH_DIR + new File(serverPath).getName()).getParentFile());

        System.out.println();

        MultiThreadedDownloader downloader = new MultiThreadedDownloader();
        downloader.downloadFile(serverPath, LOCAL_PATH_DIR + new File(serverPath).getName());
    }
}
